# 作者: 赵炳森
# 2025年10月30日02时09分03秒
# 2215031808@qq.com
class Dog(object):
    def __init__(self, name):
        self.name = name
    def game(self):
        print("%s 蹦蹦跳跳的玩耍..." % self.name)
class XiaoTianDog(Dog):
    def game(self):
        print("%s 飞到天上去玩耍..." % self.name)

class Person(object):
    def __init__(self, name):
        self.name = name
    def game_with_dog(self, dog):
        print("%s 和 %s 快乐的玩耍..." % (self.name, dog.name))
        # 让狗玩耍
        dog.game()
if __name__ == '__main__':
    zhangsan=Person("张三")
    wangcai=Dog('旺财')
    zhangsan.game_with_dog(wangcai)
    xiaotianquan=XiaoTianDog('哮天犬')
    zhangsan.game_with_dog(xiaotianquan)